﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HomePage.Master" AutoEventWireup="true" CodeBehind="NewsList.aspx.cs" Inherits="Web.Views.News.NewsList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="../../Content/style/News_Detail.css" rel="Stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlace" runat="server">
<script language="javascript">
    window.onload = function() {
        document.getElementById("news_v").className = "curr-nav";
    }
</script>
<div style="width:910px; text-align:left">
    
<!--日志根分类导航菜单--><div id="menu">
<ul>
<asp:Repeater DataSourceID="sdsNewsCategory" runat="server" ID="rptNewsCategory">
				<ItemTemplate>
					<li><a href="NewsList.aspx?categorykey=<%# Eval("NewsCategoryID") %>"><%# Eval("Text") %></a></li>			
</ItemTemplate>
</asp:Repeater>
</ul>
</div>

<div id="navigation">
    <p>您的位置： <a href="http://www.easydp.net" target="_blank">容易订票网</a> 
      &gt;&gt; <a href="index.aspx">新闻资讯</a>
     <%-- &gt;&gt; <a href="">铁路资讯</a>--%>
    </p>
</div>

<!-- /Header页首 --><!-- Content内容 -->
<div class="contentR">

<div class="mainarea">
<!--根分类最新日志列表-->
<div class="block">

<h3> <%= (Request.QueryString["categorykey"] != null) ? this.Category : this.Area%> </h3>

<ul id="newslist" class="newslist">


 <easydp:SmartGridView ID="gdvTicketList" runat="server"   AllowPaging="True" AllowSorting="true"  AutoGenerateColumns="false" DataSourceID="odsNewsList"
        PageSize="50"  BorderWidth="0"   DataKeyNames="NewsID"  ShowHeader="false" >
        <Columns>
           <asp:TemplateField>
             <ItemTemplate>
             <input type="hidden" value="<%# (Request.QueryString["categorykey"] != null)?this.Category = Eval("CategoryText").ToString():this.Area = Eval("AreaText").ToString() %>" />
          <li><a href="NewsDetail.aspx?key=<%# Eval("NewsID") %>" target="_blank"><%# Eval("Title") %></a>
<span class="smalltxt">(<%# Eval("NewsDate", "{0:MM-dd hh:mm}")%>)</span>
</li>
             </ItemTemplate>
             </asp:TemplateField>
      
        </Columns>
        <EmptyDataTemplate>
        <div style='text-align:left;margin-left:20px;line-height:20px;margin-bottom:10px;'>
		   <p style='color:#FF4E00;font-size:14px;font-weight:bold;'> 抱歉！没有查询到相关类别的资讯 ！<br /><br /></p>
			可能的原因有：<br />
			1、你输入的相关类别不正确<br />
			2、没有满足搜索条件的信息。<br /></div>
        
        </EmptyDataTemplate>
        <CustomPagerSettings PagingMode="Webabcd" TextFormat="每页{0}条/共{1}条  第{2}页/共{3}页   " />
        <PagerSettings Position="Bottom" PageButtonCount="13" FirstPageText="首页" PreviousPageText="上一页"
            NextPageText="下一页" LastPageText="末页" />
    </easydp:SmartGridView>	 
    
</ul>
</div>
</div>

<div class="sideR">
<div class="block">
<h3>最热门 <%= (Request.QueryString["categorykey"] != null) ? this.Category : this.Area%> </h3>
<ul class="msgtitlelist">

<asp:Repeater DataSourceID="sdsTopList" runat="server" ID="Repeater1">
				<ItemTemplate>
				<li>[<%# Eval("AreaText") %>] <a href="NewsDetail.aspx?key=<%# Eval("NewsID") %>" target="_blank"><%# Eval("Title") %></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
<!--月度关注热点--><!--图片资讯显示--><div class="block">
<h3>本类热点图文资讯</h3>
<ul id="scroller" class="imgthumblist">
</ul>
</div>

</div>
</div>
</div>

    <asp:ObjectDataSource ID="odsNewsList" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByCategoryOrArea" 
        TypeName="Easydp.Controllers.NewsController">
        <SelectParameters>
            <asp:QueryStringParameter Name="category" QueryStringField="categorykey" 
                Type="String" />
        <asp:QueryStringParameter Name="area" QueryStringField="areakey" 
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
    <asp:SqlDataSource ID="sdsNewsCategory" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
            SelectCommand="SELECT [NewsCategoryID], [ParentID], [Text] FROM [NewsCategory] WHERE ([ParentID] = @ParentID) ORDER BY [Sort]">
            <SelectParameters>
                <asp:Parameter DefaultValue="0" Name="ParentID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
     
     <asp:ObjectDataSource ID="sdsTopList" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataTopByCategoryOrArea" 
        TypeName="Easydp.Controllers.NewsController">
        <SelectParameters>
            <asp:QueryStringParameter Name="category" QueryStringField="categorykey" 
                Type="String" />
        <asp:QueryStringParameter Name="area" QueryStringField="areakey" 
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
    
      
</asp:Content>
